<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	template="/WEB-INF/templates/template.xhtml"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	>
	<ui:define name="content">
	
		<ui:include src="/includes/menu.xhtml"></ui:include>
		
		<h2><h:outputText value="Registrovat" /></h2>
		
		<h:outputText value="#{createUserBean.errorMessage}" rendered="#{createUserBean.error}" />
		
		<h:form>
		<h:panelGrid columns="3">
			
		
            <h:outputText value="Nick:" />
            <h:inputText id="nick" value="#{createUserBean.nick}" required="true" requiredMessage="Pole Nick je povinné." maxlength="32" />
            <rich:message for="nick"  />
            
            <h:outputText value="Heslo:" />
            <h:inputSecret id="password" value="#{createUserBean.password}" required="true" requiredMessage="Pole Heslo je povinné." maxlength="32"/>
            <rich:message for="password" />
            
            <h:outputText value="Heslo znovu:" />
            <h:inputSecret id="password2" value="#{createUserBean.passwordAgain}" required="true" requiredMessage="Pole Heslo znovu je povinné." maxlength="32"/>
            <rich:message for="password2"  />
            
            <h:outputText value="Email:" />
            <h:inputText id="email" value="#{createUserBean.mail}" required="true" requiredMessage="Pole Email je povinné." maxlength="64"/>
            <rich:message for="email"  />
            
            <h:outputText value="Jméno:" />
            <h:inputText id="name" value="#{createUserBean.name}" maxlength="64"/>
            <rich:message for="name"  />
            
            <h:outputText value="Příjmení:" />
            <h:inputText id="surname" value="#{createUserBean.surname}" maxlength="64"/>
            <rich:message for="surname"  />
            
            <h:outputText value="Město:" />
            <h:inputText id="city" value="#{createUserBean.city}" maxlength="128"/>
            <rich:message for="city"  />
            
            <a4j:commandButton value="Register" action="#{createUserBean.createUser()}"  />
        </h:panelGrid>
		</h:form>
	</ui:define>
</ui:composition>